package team.seekers.hula.system.resource.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.common.entity.PageResult;
import team.seekers.hula.system.resource.entity.dto.VideoListDTO;
import team.seekers.hula.system.resource.entity.dto.VideoCreateDTO;
import team.seekers.hula.system.resource.service.VideoService;

/**
 * date: 2022/4/25 21:33
 *
 * @author GH
 * QQ 1124813753
 */
@Slf4j
@Controller
@ApiResponseBody
@RequestMapping("/video")
public class VideoController {

    @Autowired
    private VideoService videoService;

    @GetMapping("/query")
    public PageResult<VideoListDTO> query(@RequestParam String nameKey){
        return videoService.query(nameKey);
    }

    @PostMapping("/save")
    public String save(@RequestBody VideoCreateDTO videoCreateDTO) {
        return videoService.save(videoCreateDTO);
    }

}
